package com.opengw.configuration.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;

@Entity
public class Content implements Serializable{
	
	private static final long serialVersionUID = -5147545183002475892L;
	private long contentId;
	private String contentType;
	private byte[] content;
	
	public Content(){
	}
	
	public Content(String contentType, byte[] content){
		this.setContentType(contentType);
		this.setContent(content);
	}

	public void setContentType(String contentType) {
		this.contentType = contentType;
	}

	@Column(name = "content_type")
	public String getContentType() {
		return contentType;
	}

	public void setContent(byte[] content) {
		this.content = content;
	}

	@Lob
	@Column(name = "content")
	public byte[] getContent() {
		return content;
	}
	
	public void setContentId(long contentId) {
		this.contentId = contentId;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "content_id")
	public long getContentId() {
		return contentId;
	}
	

}
